﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Fishing.Dal;
using Fishing.Model;

namespace Fishing
{
    public partial class _default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnSubmit_Click(object sender, EventArgs e)
        {

            var model = new t_ship()
            {
                shipID = Guid.NewGuid().ToString().Substring(24, 10),
                contact = txtContact.Text,
                phone = txtPhone.Text,
                shipName = txtShipName.Text,
                shipCaptain = txtShipCaptain.Text,
                shipPhone = txtShipPhone.Text,
                shipWharf = txtShipWharf.Text,
                shipAmount = txtShipAmount.Text,
                fishingPrice = txtFishingPrice.Text,
                fishingQty = txtFishingQty.Text,
                RES = txtRES.Text,
                status = ""
            };

            // 提交
            var _dal = new ShipDal();

            if (_dal.InsertDate(model))
            {
                //添加成功
                ClientScript.RegisterStartupScript(this.GetType(), "提示", "<script type='text/javascript'>alert('等待后台审核！');</script>");
            }
            else
            {
                // 添加失败
            }


        }
    }
}